<%@ page import="java.util.ArrayList" %>
<%@ page import="com.itheima.servlet.Student" %><%--<%@ page import="java.util.ArrayList" %>
<%@ page import="com.itheima.servletlet.Student" %>--%><%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2020/11/1
  Time: 18:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>查询页面</title>
</head>
<body>
<table width="500px" border="1px" align="center">
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>分数</th>
    </tr>
    <%--<%
        ArrayList<Student> list = (ArrayList<Student>) session.getAttribute("list");
        for (Student student : list) {
    %><tr align="center">
    <td>
        ${list.student.name}
        <%=
            student.getUsername()
        %>
    </td>
    <td>
        ${list.student.age}
         <%=
             student.getAge()
         %>
    </td>
    <td>
        ${list.student.score}
        <%=
            student.getScore()
        %>
    </td>
</tr>
<%}%>--%>
    <c:forEach items="${list}" var="listStu" varStatus="s">
    <tr align="center">
        <td>${s.count}</td>
        <td>${listStu.username}</td>
        <td>${listStu.age}</td>
        <td>${listStu.score}</td>
    </tr>
</c:forEach>
   <%-- <% ArrayList<Student> list = new ArrayList<>();
        Student student = new Student("张三",18,99);
    list.add(student);
    session.setAttribute("list",list);%>
    ${list.student.username}--%>




</table>
</body>
</html>
